<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/admintemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditClassesTitle}"></h:outputText>
        </ui:define>
        <ui:define name="leftmenu">
            <h:form>
                <ul class="section menu">
                    <li><a class="menuitem">#{bundle.ControlPanelMenu}</a>
                        <ul class="submenu">
                            <li><h:commandLink action="#{classesController.prepareCreate}" value="#{bundle.ListClassesCreateLink}"/> </li>
                            <li><h:commandLink action="#{classesController.prepareList}" value="#{bundle.CreateClassesShowAllLink}" immediate="true"/> </li>
                        </ul>
                    </li>
                </ul>
            </h:form>
        </ui:define>
        <ui:define name="content">
            <h2>#{bundle.EditClassesTitle}</h2>
            <div class="block">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
                </h:panelGroup>
                <h:form>
                    <table class="form">
                        <tr>
                            <td class="col1">
                                <h:outputLabel value="#{bundle.EditClassesLabel_classId}" for="classId" />
                            </td>
                            <td class="col2">
                                <h:inputText id="classId" readonly="true" class="readonly" value="#{classesController.selected.classId}" title="#{bundle.EditClassesTitle_classId}" required="true" requiredMessage="#{bundle.EditClassesRequiredMessage_classId}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputLabel value="#{bundle.EditClassesLabel_className}" for="className" />
                            </td>
                            <td class="col2">
                                <h:inputText id="className" value="#{classesController.selected.className}" title="#{bundle.EditClassesTitle_className}" required="true" requiredMessage="#{bundle.EditClassesRequiredMessage_className}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputLabel value="#{bundle.EditClassesLabel_startDate}" for="startDate" />
                            </td>
                            <td class="col2">
                                <h:inputText id="startDate" value="#{classesController.selected.startDate}" title="#{bundle.EditClassesTitle_startDate}" required="true" requiredMessage="#{bundle.EditClassesRequiredMessage_startDate}">
                                    <f:convertDateTime pattern="MM/dd/yyyy" />
                                </h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td class="col1">
                                <h:outputLabel value="#{bundle.EditClassesLabel_endDate}" for="endDate" />
                            </td>
                            <td class="col2">
                                <h:inputText id="endDate" value="#{classesController.selected.endDate}" title="#{bundle.EditClassesTitle_endDate}" required="true" requiredMessage="#{bundle.EditClassesRequiredMessage_endDate}">
                                    <f:convertDateTime pattern="MM/dd/yyyy" />
                                </h:inputText>
                            </td>
                        </tr>
                    </table>
                    <h:commandLink action="#{classesController.update}" class="btn-icon btn-teal btn-plus btn-small">
                        <span></span>
                        #{bundle.EditClassesSaveLink}
                    </h:commandLink>&nbsp;
                    <h:link outcome="View" class="btn-icon btn-teal btn-arrow-right btn-small">
                        <span></span>
                        #{bundle.EditClassesViewLink}
                    </h:link>
                </h:form>
            </div>
        </ui:define>
        <ui:define name="bottom">
            <h:form>
                <script type="text/javascript">
                    //For calendar
                    $(function() {
                        $("input[id$='endDate'], input[id$='startDate']").datepicker({
                            dateFormat: 'mm/dd/yy',
                            showOn: "button",
                            buttonImage: "../../resources/img/calendar.gif",
                            buttonImageOnly: true
                        });
                    });

                </script>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
